﻿using sql_data_generator.FieldOptions;
using sql_data_generator.Generators;

namespace sql_data_generator.Randomizers
{
    class RandomizerFixedSet : BaseRandomizer<FieldOptionsFixedSet>, IRandomizer
    {
        private readonly RandomStringFromListGenerator _generator;

        public RandomizerFixedSet(FieldOptionsFixedSet options)
            : base(options)
        {
            _generator = new RandomStringFromListGenerator(options.Values);
        }

        public object GetData()
        {
            return IsNull() ? null : Options.Values.Count > 0 ? _generator.Generate() : string.Empty;
        }
    }
}